package com.lvhx.controller;

import com.lvhx.dao.OrderMapper;
import com.lvhx.pojo.Acctbal;
import com.lvhx.pojo.Order;
import io.swagger.annotations.Api;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "测试Mysql")
@RestController
public class MysqlTestController {

    @Resource
    private OrderMapper orderMapper;

    @Transactional
    @PostMapping("/testManagerBySpring")
    public String testManagerBySpring(){

        Order order = orderMapper.selectByPrimaryKey("1");
        order.setMessageId("AAA");
        orderMapper.updateByPrimaryKeySelective(order);

        return "success";
    }
}
